//
//  Allproducts.swift
//  NewLndd
//
//  Created by 邵禹曦 on 2020/1/2.
//  Copyright © 2020 辽宁当代. All rights reserved.
//

import UIKit
// MARK: - 全部商品
class Allproducts: NSObject {
    // MARK: - 定义属性
    var AllProducts : Allproducts?
    
    // MARK: - 属性
    var CON : String? = "---"      // 商品名称
    var COI : String?  = "---"     //商品代码
    var BP : String? = "---"
    var BQ : String? = "---"
    
    var purLowBP : String? = "---"           // 买挂单最低报价
    var purHighBP : String?  = "---"        // 买挂单最高报价
    var purLowBQ : String?  = "---"          // 买挂单最低报价量
    var purQ : String? = "---"              // 买挂单，挂单量
    
    var sellLowBP : String? = "---"          // 卖挂单最低报价
    var sellHighBP : String?  = "---"         // 卖挂单最高报价
    var sellLowBQ : String? = "---"     // 卖挂单最低报价量
    var sellQ : String? = "---"           // 卖挂单，挂单量
    var source : [String : AnyObject]?
    var sta : String? // 买：1 卖：2
    var st : String = "0" // 快照
    
    
    //var REP : AllProductsViewModel?
    
    
    
    
    // MARK: - 自定义构造函数
    init(dict : [String : AnyObject]) {
        super.init()
        setValuesForKeys(dict)
        
        // 商品名称(商品编号)
        COI = (dict["COI"] as? String)
        CON = (dict["CON"] as! String)  + "(" + (dict["COI"] as! String) + ")"
        purLowBP = (dict["BLP"] as? String)
        purHighBP = (dict["BHP"] as? String)
        purLowBQ = (dict["BHPC"] as? String)
        purQ = (dict["BQ"] as? String)
        
        
        sellLowBP  = (dict["LP"] as? String)
        sellHighBP = (dict["HP"] as? String)
        purLowBQ = (dict["SLPC"] as? String)
        sellQ = (dict["Q"] as? String)
        

    }
    
    
    // 重写
    override func setValue(_ value: Any?, forUndefinedKey key: String) {}
}
